package com.hailiang.saas.auth.common;

/**
 * @author : pangfuzhong
 * @description
 * @date : 2021/9/27 14:01
 */
public class Constant {

    public static final String USERNAME = "userName", PASSWORD = "password", MATCH_ALL_PATH = "/**";

    public static final String SUCCESS = "SUCCESS", FAILURE = "FAILURE", TOKEN_KEY_PREFIX = "token", OFFLINE_KEY = "ELSE_WHERE", OFFLINE_VALUE = "OFFLINE_VALUE";

    public static final String VERIFICATION_CODE_KEY = "VERIFICATION_CODE";

    // 登陆方式
    public static final String ENDPOINT_HEADER = "endpoint";

    // 登陆渠道
    public static final String CHANNEL_HEADER = "channel";

    // 验证码类型
    public static final String VERIFICATION_TYPE_HEADER = "verificationType";

    // 登陆信息
    public static final String USER_AGENT = "User-Agent";

    public static final String TOKEN_HEADER = "Authorization";
    public static final String TOKEN_SPLIT = "Bearer";
    public static final String POST = "POST", GET = "GET";
    public static final String VERIFICATION_CODE = "verificationCode";
    public static final String OLD_PASSWORD = "oldPassword";
    public static final String NEW_PASSWORD = "newPassword";

    public static final String APPLICATION_JSON = "application/json; chartset=UTF-8";
    public static final String CHARACTER_ENCODING_UTF8 = "UTF-8";

    /*************************************************** 错误码 ***************************************************/

    public static final String TOKEN_GENERATE_FAILURE_CODE = "10000";
    public static final String TOKEN_GENERATE_FAILURE_MSG = "[认证中心] token生成失败";
    public static final String TOKEN_STORE_REDIS_FAILURE_CODE = "10001";
    public static final String TOKEN_STORE_REDIS_FAILURE_MSG = "[认证中心] token存入redis失败";
    public static final Integer TOKEN_CHECK_FAILURE_CODE = 10002;
    public static final String TOKEN_CHECK_FAILURE_MSG = "[认证中心] token校验未通过";
    public static final String LOGIN_AUTH_FAILURE_CODE = "10003";
    public static final String LOGIN_AUTH_FAILURE_MSG = "[认证中心] 用户登陆认证失败";

    public static final String TOKEN_INVALID_KICK_OUT_CODE = "10004";
    public static final String TOKEN_INVALID_KICK_OUT_MSG = "[认证中心] token失效, 当前账户已在其他站点登陆";

    public static final String TOKEN_INVALID_OVERDUE_CODE = "10005";
    public static final String TOKEN_INVALID_OVERDUE_MSG = "[认证中心] token失效, 长时未操作或已登出或从未登陆";

    public static final String TOKEN_INVALID_WRONGFUL_CODE = "10006";
    public static final String TOKEN_INVALID_WRONGFUL_MSG = "[认证中心] token失效, 不合法";

    public static final String TOKEN_CHECK_EXCEPTION_CODE = "10007";
    public static final String TOKEN_CHECK_EXCEPTION_MSG = "[认证中心] token校验过程异常";

    public static final String LOGOUT_SUCCESS_CODE = "10008";
    public static final String LOGOUT_SUCCESS_MSG = "[认证中心] 登出成功";

    public static final String LOGOUT_RELEASE_REDIS_KEY_CODE = "10009";
    public static final String LOGOUT_RELEASE_REDIS_KEY_MSG = "[认证中心] 登出释放资源异常";

    public static final String LOGOUT_ACCOUNT_MATCH_TOKEN_CODE = "10010";
    public static final String LOGOUT_ACCOUNT_MATCH_TOKEN_MSG = "[认证中心] 登出账号与token不匹配";

    public static final String ACCOUNT_NEVER_LOGIN_CODE = "10011";
    public static final String ACCOUNT_NEVER_LOGIN_MSG = "[认证中心] 账号未登录, 登出失败";


    // 验证码相关

    public static final String VERIFICATION_AUTH_HANDLER_CODE = "10012";
    public static final String VERIFICATION_AUTH_HANDLER_MSG = "[认证中心] 验证码认证处理异常";

    public static final String VERIFICATION_TYPE_WRONGFUL_CODE = "10013";
    public static final String VERIFICATION_TYPE_WRONGFUL_MSG = "验证码类型不合法";
}
